<template>
  <div>数据在< script >里</div>
</template>

<script>
var obj = {}
var str = "string"
var num = 123,
  bool = true,
  arr = [],
  reg = /a-z/,
  fn = function() {},
  obj_null = null,
  undf = undefined,
  obj2 = new Object(),
  obj_str = new String("string"),
  obj_num = new Number(),
  obj_bool = new Boolean(),
  obj_arr = new Array(),
  obj_reg = new RegExp(),
  obj_fn = new Function(),
  obj_date = new Date();

function checkType(param) {
  var typeName = {
    "[object Function]": "function",
    "[object Boolean]": "boolean",
    "[object Number]": "number",
    "[object String]": "string",
    "[object Object]": "object",
    "[object RegExp]": "regExp",
    "[object Array]": "array",
    "[object Error]": "error",
    "[object Date]": "date"
  };
  var toStringFn = Object.prototype.toString //获取到对象的toString方法
  if (param == null) {
    return String(param) //js自带的的String方法，用于检测null和undefined
  }
  return typeof param === "object" || typeof param === "function"
    ? typeName[toStringFn.call(param)]
    : typeof param;
}

export default {}
</script>
